package com.example.zg.androidnewview.adapter;

import android.view.View;
import android.view.ViewGroup;

import java.util.List;

/**
 * 创建日期:2019/1/9 on 14:47
 * 描述：
 * 作者: zhougan
 */
public abstract class BaseAdapter<T> extends android.widget.BaseAdapter {
    private List<T> data;

    public void setData(List<T> data) {
        this.data = data;
    }

    @Override
    public int getCount() {
        if(data!=null){
            return data.size();
        }
        return 0;
    }

    @Override
    public Object getItem(int position) {
        if(data!=null){
            return data.get(position);
        }
        return null;
    }

    @Override
    public long getItemId(int position) {
        return position;
    }






}
